﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<mediatheque.Areas.Admin.Models.Oeuvres>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Index
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <section class="featured">
        <div class="content-wrapper">
            <hgroup class="title">
                <h1>Médiatheque Geek&Rock</h1>
            </hgroup>       
            <h2>&laquo;Un homme sans culture ressemble à un zèbre sans rayures.&raquo;</h2>
            <p>
                Grace à a médiathèque <strong>Geek&Rock</strong>, consultez notre gigantesque collections de livres, musiques, films.<br />
                Retrouvez vos auteurs préférés, vos coups de coeur et commander les sans plus attendre en quelques clics.
            </p>
        </div>
    </section>
    <ul class="breadcrumb">
        <li><a href="/Film">Tous Les films</a> <span class="divider">&raquo;</span></li>
        <li class="active"><%= Model.movieData[0].title %></li>
    </ul>
    <div class="span3 pull-right">
        <% if (Model.getStockForMovie(Model.movieData[0].id) < Model.movieData[0].stock)
           { %>
           
           <% if (HttpContext.Current.Session["login_id"] != null)
              {%>
              <span class="badge badge-success"><i class="icon-ok icon-white"></i> En Stock</span>
              <% if (!Model.isBorrowed(int.Parse(Session["login_id"].ToString()), Model.movieData[0].id, "dvd"))
                 { %>
              <a href="/Film/Emprunt/<%= Model.movieData[0].id %>" class="btn btn-small">Je l'emprunte</a>
              <%} else { %>
              <a href="/Film/Rendu/<%= Model.movieData[0].id %>" class="btn btn-small btn-info">Je le rapporte</a>
              <% } %>
           <% }
              else
              { %>
              <a href="/Account/Logon" class="btn btn-small">Je me connecte pour emprunter</a>
           <% } %>
        <% }
           else
           { %>
           <span class="badge badge-danger">Rupture de stock <i class="icon-remove icon-white"></i></span>
        <% } %>
    </div>
    <div class="media span8">
      <a class="pull-left" href="#">
        <img class="media-object" style="width:160px;height:220px;" src="../../Content/i/media/films/<%= Model.movieData[0].cover %>" />
      </a>
      <div class="media-body">
        <h3 class="media-heading"><%= Model.movieData[0].title %></h3>
        <div class="media">
            <table >
                <tr>
                    <td><span class="badge badge-inverse">Année de sortie</span></td>
                    <td><strong><%= Model.movieData[0].release_year %></strong></td>
                </tr>
                <tr>
                    <td><span class="badge badge-inverse">Réalisé par</span></td>
                    <td><strong>
                    <% foreach (var cat in Model.getRealForMovie(Model.movieData[0].id)) { %>
                    <%= cat.firstname + "  " + cat.lastname +  ", " %>
                    <% } %>
                    </strong>
                    </td>
                </tr>
                <tr>
                    <td><span class="badge badge-inverse">Acteurs</span></td>
                    <td><strong>
                    <% foreach (var cat in Model.getActorForMovie(Model.movieData[0].id)) { %>
                    <%= cat.firstname + "  " + cat.lastname +  ", " %>
                    <% } %>
                    </strong>
                    </td>
                </tr>
                <tr>
                    <td><span class="badge badge-inverse">Genres</span></td>
                    <td><strong>
                    <% foreach (var cat in Model.getCategoriesForMovie(Model.movieData[0].id)) { %>
                    <%= cat.lib + ", " %>
                    <% } %>
                    </strong>
                    </td>
                </tr>
            </table>
        </div>
        <p class="resume">
            <%= Model.movieData[0].resume %>
        </p>
      </div>
    </div>
    <hr />
</asp:Content>

